package com.goodving.guli.bt.lua;

import android.content.Context;

import de.greenrobot.gulidao.DaoMaster;
import de.greenrobot.gulidao.DaoSession;
import de.greenrobot.gulidao.DevOpenHelper;
import de.greenrobot.gulidao.LuaListDao;
import de.greenrobot.gulidao.LuaListDaoHelper;
import de.greenrobot.gulidao.LuaZipFileDao;


/**
 * Created by john on 2015/12/7.
 */
public class DaoManager { //  C1333k
    private static DaoManager mDaoManager;
    private static Context mContext;
    DaoSession daoSession; // f6836a

    static {
        mDaoManager = null;
        mContext = null;
    }

    private DaoManager(Context context) {
        this.daoSession = null;
        this.daoSession = new DaoMaster(new DevOpenHelper(context, LuaListDaoHelper.LUA_DB, null).getWritableDatabase()).newSession();
    }

    public static DaoManager getInstance() { // m11663a
        if (mDaoManager == null) {
            mDaoManager = new DaoManager(mContext);
        }
        return mDaoManager;
    }

    public static void m11664a(Context context) {
        mContext = context;
    }

    public LuaListDao getLuaListDao() { // m11665b
        return this.daoSession.getLuaListDao();
    }

    public LuaZipFileDao getLuaZipFileDao() { // m11666c
        return this.daoSession.getLuaZipFileDao();
    }
}
